package com.foreverwin.mes.lims.service.impl;

import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.lims.mapper.SamplingMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.foreverwin.mes.lims.model.Sampling;
import com.foreverwin.mes.lims.service.SamplingService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mark
 * @since 2020-03-09
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SamplingServiceImpl extends ServiceImpl<SamplingMapper, Sampling> implements SamplingService {


    @Autowired
    private SamplingMapper samplingMapper;

    @Override
    public Page<Sampling> selectPage(FrontPage<Sampling> frontPage, Sampling sampling) {
        EntityWrapper<Sampling> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(sampling);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<Sampling> selectList(Sampling sampling) {
        EntityWrapper<Sampling> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(sampling);
        return super.selectList(queryWrapper);
    }


}